//package org.karelun.rabbit.rcp.command;
//
//import org.eclipse.gef.commands.Command;
//import org.eclipse.gef.commands.CompoundCommand;
//import org.karelun.rabbit.graph.Connection;
//import org.karelun.rabbit.graph.Diagram;
//import org.karelun.rabbit.graph.Shape;
//
//public class DeleteShapeCommand extends Command{
//	
//	private Diagram diagram;
//	
//	private Shape shape;
//	
//	public DeleteShapeCommand(Diagram diagram, Shape shape) {
//		this.diagram=diagram;
//		this.shape=shape;
//	}
//	
//	@Override
//	public void execute() {
//		 diagram.getShapes().remove(shape);
//	}
//	
//	@Override
//	public void undo() {
//		diagram.getShapes().add(shape);
//	}
//	
//	public CompoundCommand createCompoundCommand(){
//		CompoundCommand compoundCommand = new CompoundCommand();
//		compoundCommand.add(this);
//		
//		for(Connection conn:shape.getSourceConnections()){
//			DeleteConnectionCommand cmd = new DeleteConnectionCommand(conn);
//			compoundCommand.add(cmd);
//		 }
//		for(Connection conn:shape.getTargetConnections()){
//			DeleteConnectionCommand cmd = new DeleteConnectionCommand(conn);
//			compoundCommand.add(cmd);
//		 }
//		return compoundCommand;
//	}
//}
